<template>
  <div class="home">
    <el-container>
      <el-header style="height: 55px">
        <div class="header">
          <h3 class="header-h3">仮面ライダー订餐管理系统</h3>
          <div class="avatar-div">
            <img :src="avatar"/>
            <a href="#">注销</a>
          </div>
        </div>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu
            default-active="2"
            :router="true"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
          >
            <el-submenu>
              <template slot="title">
                <i class="el-icon-food"></i>
                <span>菜品管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/addDish">添加菜品</el-menu-item>
                <el-menu-item index="/showDish">查询菜品</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-fork-spoon"></i>
                <span>菜品分类管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="1-1">添加菜品分类</el-menu-item>
                <el-menu-item index="1-2">查询菜品分类</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-main>
        
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template> 
<script>
export default {
  data() {
    return {
      avatar: "",
    };
  },
  created() {
    let storage = window.sessionStorage;
    let avatar = storage.getItem("avatar");
    this.avatar = avatar;
  },
};
</script>
<style scoped>
.home {
  height: 100%;
}
.el-container {
  height: 100%;
}
.el-header >>> {
  padding: 0px;
  height: 55px;
}
.el-menu >>> {
  border-right: 0px;
}
.el-aside >>> {
  min-height: 400px;
  background: #545c64;
}
.header {
  height: 55px;
  background: #09c;
}
.header-h3 {
  margin: 0px;
  height: 55px;
  line-height: 55px;
  text-align: center;
  color: #fff;
}
.avatar-div {
  position: absolute;
  height: 55px;
  right: 0px;
  top: 0px;
  text-align: center;
  line-height: 55px;
  z-index: 1;
}
.avatar-div > img {
  width: 40px;
  height: 40px;
  margin: 8px 55px 0px;
  border-radius: 50%;
}
.avatar-div > a {
  font-size: 12px;
  color: #000;
  text-decoration: none;
  margin-right: 20px;
  position: absolute;
  right: 0px;
  top: 0px;
}
.avatar-div > a:hover {
  color: red;
}
</style>